//
//  MethodData.m
//  __PRODUCTNAME__
//
//  Created by LL.F on 16/09/13
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "MethodData.h"
#import "MethodStep.h"
#import "MethodTags_Info.h"

@implementation MethodData

+ (NSDictionary *)objectClassInArray{
    return @{@"step" : [MethodStep class], @"tags_info" : [MethodTags_Info class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"step"]) {
        NSMutableArray<MethodStep *>  *secDataArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            MethodStep *secData = [MethodStep modelWithDic:dic];
            [secDataArray addObject:secData];
        }
        _step = secDataArray;
    } if ([key isEqualToString:@"tags_info"]) {
        NSMutableArray<MethodTags_Info *>  *infoArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            MethodTags_Info *infoData = [MethodTags_Info modelWithDic:dic];
            [infoArray addObject:infoData];
        }
        _tags_info = infoArray;

    }
}

@end
